//
//  WBBaseViewController.m
//  WeiBo
//
//  Created by ChenJunWen on 2017/11/29.
//  Copyright © 2017年 CJW. All rights reserved.
//

#import "WBBaseViewController.h"

@interface WBBaseViewController ()

/** 导航栏 */
@property (nonatomic, strong) UINavigationBar *customNavBar;

@end

@implementation WBBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self setupUI];
}

- (void)setupUI {
    self.view.backgroundColor = [UIColor jw_randomColor];
    
    [self setupNavigationBar];
}

- (void)setupNavigationBar {
    self.customNavBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, UIScreen.jw_screenWidth, 64)];
    [self.view addSubview:self.customNavBar];
    UINavigationItem *customNavItem = [[UINavigationItem alloc] init];
    self.customNavItem = customNavItem;
    self.customNavBar.items = @[self.customNavItem];
    
    self.customNavBar.barTintColor = [UIColor jw_colorWithHex:0xf6f6f6];
    self.customNavBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor darkGrayColor]};
    self.customNavBar.tintColor = [UIColor orangeColor];
}

#pragma mark - setter
- (void)setNavTitle:(NSString *)navTitle {
    if (navTitle) {
        _navTitle = navTitle;
        
        self.customNavItem.title = navTitle;
    }
}


@end
